<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		
		
		<script>
			
			function clickinner(e){
				console.log("点击的是内部红色的框");
				
				//需要消耗事件，停止事件的传播，
				 let event = window.event?window.event:e;
				 event.stopPropagation();
				
				 // let clientX = event.clientX
				 // let clientY = event.clientY
				 
				 
				 let {clientX , clientY} = event;

				 
				// console.log("event",event)
				// console.log("clientX",clientX)
				// console.log("clientY",clientY)
				
			}
			
			function clickouter(){
				console.log("点击的是[外部]大框");
			}
			
			
			
			function inputChar(e){
				 let event = window.event?window.event:e;
				 if(event){
					console.log("event",event) 
				 }
			}
			
			function clickAhref(e){
				let event = window.event?window.event:e;
				event.preventDefault();
				alert(1);
			}
		</script>
	
		
	</head>
	<body>
		
		<a href="https://www.baidu.com" onclick="clickAhref(event)">百度</a>
		
		
		
		<input type="text" oninput="inputChar(event)">
		
		
		
		<div  style="width:500px;height:500px;border:solid 1px #999" onclick="clickouter()">	
						
				<div  style="width:300px;height:300px;background-color:#FF0000" onclick="clickinner(event)">			
								
				</div>		
						
						
		</div>
		
		
		
	
	</body>
</html>